package site.fsyj.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author fsyj on 2022/3/8
 */
public class ResourceUtil {
    public static Properties getConfigure(String relativePathName) {
        Properties properties = new Properties();
        try {
            String path = getPath(relativePathName);
            InputStream stream = new FileInputStream(path);
            properties.load(stream);
        } catch (IOException e) {
            return null;
        }
        return properties;
    }
    public static String getPath(String relativePathName) {
        return System.getProperty("user.dir") + File.separator + "classes" + File.separator + relativePathName;
    }
}
